Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext

RE: Linux Startup Script
~Ben Opfooverader 31.Dec.02 08:34 AM a Web browser
Domino Server 6.0 Linux - RedHat


First use Webmin (www.webmin.com) to manage your Linux Server .


info ands scripts: (http://www.lesbell.com.au/Home.nsf/6db7c24b7bb73f0d4a25665c003eae45/ac3934bc047107bcca2569f1000f4f78?OpenDocument)


Managing Lotus Domino on Linux
Lotus Domino 5.0 is now available for the Linux platform. After installation, the Domino server can be started and will run perfectly OK, but there are still a few post-installation issues to be resolved, such as arranging for the server to automatically start after a reboot, dealing with mail from cron jobs and arranging for remote management.

This note describes one approach that I have taken to these problems. There are other techniques that will suit other people's requirements, but at least this will get you started. . .

The techniques that are described below were tested on a server running Caldera eServer 2.3 with various updates applied. In almost all respects this is a standard setup, and the scripts should work on a RedHat system, for example. However, I have put the Notes data files in /var/local/notesdata rather than the default /local/notesdata, and the scripts may need to be modified accordingly.

For anyone using Caldera eServer 2.3 or 3.1, I am working on a slightly modified script which uses a /etc/sysconfig/daemons/domino script to set various variables. I'm also considering writing a Webmin module for Domino server management.

Initialization Script

The following script is adapted from the one provided in Appendix F, "Scripts" of the IBM Redbook, "Lotus Domino R5 for Linux on IBM Netfinity Servers" (SG24-5968). For a full understanding of how it works, you should consult that Redbook, which provides lots of useful background information. The only problem is that the script in the book won't work, due to a fairly obvious error, and incorrect instructions are provided for creating symlinks.

This script should be created as /etc/rc.d/init.d/domino:

#!/bin/sh
#
# domino Start/stop the Lotus Domino server
#
# chkconfig: 345 95 95
# description: This script is used to start and stop the domino
# server as a background process. It will send
# the serverID password from a file to the server.
# Communication with the server has to be done through
# console, Notes Administrator or webadmin.
#
# Usage: /etc/rc.d/init.d/domino start|stop
#
# process name: server, ...

# Change the USER, GROUP, DATA_DIR and BIN_DIR for your server
DOMINO_USER="notes"
DOMINO_GROUP="notes"
DOMINO_DATA_DIR="/var/local/notesdata"
DOMINO_BIN_DIR="/opt/lotus/bin"

# We need a file to put the serverID password in.
# Make sure the owner is the Domino owner and the file
# permissions are set to 400

SERVER_PASSWD_FILE="/var/local/notesdata/.domino.pwd"

# See if the user that runs this script is root

if [ `id -u` != 0 ]; then
echo "This script must be run by root only"
exit 1
fi

# See how we were called.

case $1 in

start)
# First, check if the password file exists,
# and if not, exit with an errorcode
if [ ! -f $SERVER_PASSWD_FILE ] ; then
echo "Error: no password file."
exit 1
fi

# Set permission to 400 (read-only-owner)
# and ownership to $DOMINO_USER. These next lines are
# not necessary if the ownership was set correctly the first time.

chmod 400 $SERVER_PASSWD_FILE
chown $DOMINO_USER.$DOMINO_GROUP $SERVER_PASSWD_FILE

# Two ways to run the server (comment one of them out)
# 1. With the output of the console redirected to /var/log/domino.log
# Be sure to change the logrotate daemon.
# 2. With the output of the console redirected to /dev/null

echo -n "Starting domino server..."

# Version with logfile
su - ${DOMINO_USER} -c "cd ${DOMINO_DATA_DIR};\
cat ${SERVER_PASSWD_FILE} | ${DOMINO_BIN_DIR}/server" \
>> /var/log/domino 2>&1 &

# Version without logfile
# su - ${DOMINO_USER} -c "cd ${DOMINO_DATA_DIR};\
# cat ${SERVER_PASSWD_FILE} |\
# ${DOMINO_BIN_DIR}/server" > /dev/null 2>&1 &

echo "done."
;;

stop)
echo -n "Stopping Domino server. "
su - ${DOMINO_USER} -c "cd ${DOMINO_DATA_DIR}; ${DOMINO_BIN_DIR}/server -q"
;;

*)
echo "Usage: domino {start|stop}"
exit 1
;;

esac

exit 0
# End of the domino script

Now, create symlinks to start the Domino server at runlevels 3 and 5 with the following commands:

ln -s /etc/rc.d/init.d/domino /etc/rc.d/rc3.d/S98domino

ln -s /etc/rc.d/init.d/domino /etc/rc.d/rc5.d/S98domino

And create symlinks to stop the server at runlevels 1 (single-user), 0 (halt) and 6 (reboot) with the following commands:

ln -s /etc/rc.d/init.d/domino /etc/rc.d/rc1.d/K05domino

ln -s /etc/rc.d/init.d/domino /etc/rc.d/rc0.d/K05domino

ln -s /etc/rc.d/init.d/domino /etc/rc.d/rc6.d/K05domino

It would be advisable to test this setup by invoking the script directly:

/etc/rc.d/init.d/domino stop

/etc/rc.d/init.d/domino start

as well as testing it by rebooting as well as changing runlevels with the init or telinit commands.

Log Rotation

The stdout of the Domino server has now been redirected to /var/log/domino - and as you probably know, a Domino server console generates a lot of text, so the file will grow rapidly. To deal with this, you will need to configure the logrotate daemon to periodically copy the existing log file to a new file, compress it to save space and delete the oldest log file.

Here's my /etc/logrotate.d/domino file (from a Caldera eServer system; the location may be different for Red Hat, etc):

/var/log/domino {
rotate 7
daily
copytruncate
compress
errors hostmaster@lesbell.com.au
}

This configuration file will keep sever versions of the log file, and each day wil create a new one (deleting the oldest). It copies the current file then truncates it in situ so that the Domino server simply continues to write its console output. The downside of this is that there may be a few seconds, worst case, during which output is lost. The old files are compressed using gzip, and any errors are mailed to hostmaster@lesbell.com.au - substitute your own email addres here, obviously.

Remote Management with Webmin

Webmin provides a web-based remote management interface for Linux (and other UNIX) systems. It is easy to extend Webmin to allow remote management of the Domino server by combining the above command with Webmin's "Custom Commands" feature.

After installing Webmin, start it, then connect to your server from a browser and click on the "Others" tab, followed by "Custom Commands". Click on "Create a new custom command" to create each of the following commands: Command Description Command Run as user
Start Domino Server /etc/rc.d/init.d/domino start root
Stop Domino Server /etc/rc.d/init.d/domino stop root
Tail of Domino Log tail -100 /var/log/domino root


Dealing with Frozen Server Threads

During the early days of my switch to Domino 5.0 on Linux, I had constant problems with the server crashing due to a trap b, with the message "All server threads frozen" (fixed as of Domino 5.0.6a, mercifully!). I wrote a script called crash to kill the server from the command line when this happened:

#!/bin/bash
# Script to create diagnostic dumps after Domino server crash, then restart
PATH=/opt/lotus/bin:$PATH
# Set up ulimit to allow 100 MB core files
ulimit -c 102400
# Write initial diagnostic dump to ~notes
cd
# Get a diagnostic dump
/opt/lotus/bin/nsd
# Then change to the notes data directory
cd /var/local/notesdata
# Kill all Domino server processes
/opt/lotus/bin/nsd -k
# Need a second run to get all
/opt/lotus/bin/nsd -k
# One more for luck?
/opt/lotus/bin/nsd -k
# It turns out three was not enough
/opt/lotus/bin/nsd -k

This script is intended to be run when logged in as user "notes", rather than root - the nsd utility misbehaves when run as root. It can be invoked from within Webmin:

Command Description Command Run as user
Kill Crashed Domino Server /home/notes/crash notes


Sendmail on the Same System

The next problem is that, with a default installation, the sendmail MTA that was probably installed on your system has never been configured. It will certainly not be running, since Domino will probably be handling incoming SMTP emails.

As a result, if you have crontab configured to email the output of cron jobs to you (I use hostmaster@lesbell.com.au for this), it will fail, with the mail log indicating that the MX record for the domain points back to the host itself. The fix in this case is to configure sendmail on the Domino server to use another machine as a smart relay host. You can use a backup mail server for this purpose - for example, I have an old machine called abelard.lesbell.com.au configured as a backup mail server and mailing list machine. To configure the Domino server machine to use smart relay, edit /etc/sendmail.cf and somewhere near the top, add a line like this one, naming your own relay, obviously:

DSabelard.lesbell.com.au

Future Enhancements

Although I have only been running this server for a few weeks so far, the indications are that it is rock solid (after some early instability, fixed by moving to 5.0.6a). However, I am going to experiment with putting the Domino data directory on a ReiserFS journalling file system, to see if this can speed reboots after any power outages (gotta put that UPS in soon!).

I am also going to attempt to modify the start/stop script to run the server from the screen utility, which will allow remote connections to the console.

References

Morrison, David, Jean-Claude Daunois, Joe Rinck and Geerten Schram, "Lotus Domino R5 for Linux on IBM Netfinity Servers", IBM Corp., September 2000. Document SG24-5968. May be downloaded from http://www.redbooks.ibm.com.
Back to Home Copyright © 1987-2002 Les Bell and Associates Pty Ltd. All rights reserved. webmaster@lesbell.com.au

...........................


Have Fun,

Arjen Essink
a.essink@puntdoc.net




automatic start linux (~Umberto Fezfoo... 27.Dec.02)
. . search this forum on startup script... (~Anita Elrevitc... 27.Dec.02)
. . RE: automatic start linux (~Isaac Elfreema... 27.Dec.02)
. . Linux Startup Script (~Dexter Fezhipi... 27.Dec.02)
. . . . For those new to linux (~Chloe Quetvelu... 30.Dec.02)
. . . . RE: Linux Startup Script (~Ben Opfooverad... 31.Dec.02)
. . RE: automatic start linux (~Patti Quetfool... 13.Apr.03)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS